package com.kongxx.wicketstudy.component.form;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.model.Model;

public class FormPage1 extends WebPage {
	private static final long serialVersionUID = 1L;

	private Model model;
	
	public FormPage1() {
		FeedbackPanel feedback = new FeedbackPanel("msgs");
		add(feedback);
		
		Form form = new Form("myform"){
			protected void onSubmit() {
				//String name = (String)model.getObject();
			}
		};
		
		model = new Model();
		TextField textField = new TextField("name", model);
		textField.setRequired(true);
		form.add(textField);
		add(form);
		add(new Label("name", model));
	}
}
